package com.tools.hry.xls.exception;

/**
 * Excel解析异常
 */
public class ExcelParseException extends Exception {
    private static final long serialVersionUID = 1L;
    private String message;
    private int rowNum;
    private int cellIndex;

    public ExcelParseException(Exception e) {
        initCause(e);
    }

    public ExcelParseException(String message) {
        this.message = message;
    }

    public ExcelParseException(String message, Exception e) {
        initCause(e);
        this.message = message;
    }
    public ExcelParseException(String message, Exception e, int rowNum, int cellIndex) {
        initCause(e);
        this.message = message;
        this.rowNum=rowNum;
        this.cellIndex=cellIndex;
    }

    @Override
    public String getMessage() {
        if (message == null) {
            return super.getMessage();
        }
        return message;
    }

    public int getRowNum() {
        return rowNum;
    }

    public void setRowNum(int rowNum) {
        this.rowNum = rowNum;
    }

    public int getCellIndex() {
        return cellIndex;
    }

    public void setCellIndex(int cellIndex) {
        this.cellIndex = cellIndex;
    }
}
